' ***********************************************************************
' Assembly         : Ioc
' Author           : Tim Ford
' Created          : 10-02-2013
'
' Last Modified By : Tim Ford
' Last Modified On : 10-02-2013
' ***********************************************************************
' <copyright file="IocContainerCollection.vb" company="Red Baron Solutions">
'     Red Baron Solutions. All rights reserved.
' </copyright>
' <summary></summary>
' ***********************************************************************


Namespace Ioc.Configuration
    ''' <summary>
    ''' 	
    ''' </summary>
    Public Class IocContainerCollection
        Inherits System.Configuration.ConfigurationElementCollection
        ''' <summary>
        ''' Initializes a new instance of the <see cref="IocContainerCollection" /> class.	
        ''' </summary>
        ''' <remarks></remarks>
        Public Sub New()

        End Sub
        ''' <summary>
        ''' Initializes a new instance of the <see cref="IocContainerCollection" /> class.	
        ''' </summary>
        ''' <param name="comparer">The comparer.</param>
        ''' <remarks></remarks>
        Protected Sub New(ByVal comparer As IComparer)
            MyBase.New(comparer)

        End Sub
        ''' <summary>
        ''' Gets or sets the item.	
        ''' </summary>
        ''' <value>The item.</value>
        ''' <remarks></remarks>
        Default Public Shadows Property Item(index As Integer) As IocContainerElements
            Get
                Return TryCast(MyBase.BaseGet(index), IocContainerElements)
            End Get
            Set(value As IocContainerElements)
                If MyBase.BaseGet(index) IsNot Nothing Then
                    MyBase.BaseRemoveAt(index)
                End If
                Me.BaseAdd(index, value)
            End Set
        End Property
        ''' <summary>
        ''' Creates the new element.	
        ''' </summary>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Protected Overrides Function CreateNewElement() As System.Configuration.ConfigurationElement
            Return New IocContainerElements()
        End Function

        ''' <summary>
        ''' Gets the element key.	
        ''' </summary>
        ''' <param name="element">The element.</param>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Protected Overrides Function GetElementKey(element As System.Configuration.ConfigurationElement) As Object
            Return DirectCast(element, IocContainerElements).Type
        End Function
    End Class
End Namespace

